<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<body>
<?
$path = '../Mkart/';
include($path."common.php");

//參數設定

//公司名稱
$company = "宏醫生技銀行-健康購物網" ;

//管理者信箱
$admin_mail = "shdio@pchome.com.tw" ;
$admin_smtp = "smtp.pchome.com.tw" ;
$mail_account = "shdio" ;
$mail_pwd = "SHDIO" ;

//訂單編號
$order_no =  trim($_POST['od_sob']) ;

//出貨處理日
$p_date = substr($_POST['process_date'],0,4) . "/" .  substr($_POST['process_date'],4,2) . "/"  . substr($_POST['process_date'],6,2);

//出貨所需日期
$n_date = "3";

//到貨日
$tmp_date =strtotime($_POST['process_date']);
$end_date =  date("Y/m/d",strtotime("+$n_date days",$tmp_date));

//
$sql_num = "select * from order_shopper where  order_id = '$order_no' " ;
$result_num = mysql_query($sql_num) ;
$row_num=mysql_fetch_object($result_num) ;
$order_name = $row_num->shopper_name ;
$order_mail = $row_num->shopper_mail;

$mail_Subject = $order_name."　您好,您在".$company."訂購商品已出貨！";

?>
<table width=500 border=0>
<tr>
<td>**************************************************************************************</td>
</tr>
<tr>
<td>請注意︰此郵件是系統自動傳送，請勿直接回覆此郵件。</td>
</tr>
<tr>
<td>**************************************************************************************</td>
</tr>
<tr height=20><td><hr></td></tr>

<tr>
<td>感謝您向<?php echo $company?>訂購商品，您訂購的商品資訊如下:</td>
</tr>

<tr>
<td>訂單編號：<?php echo $order_no?></td>
</tr>

<tr>
<td>
<table width=100% border=1>
<tr>
<td align=center>商品名稱</td>
<td align=center width=20%>數量</td>
</tr>
<?php
$sql_item = "select * from  order_item where order_id = '$order_no' order by order_id" ;
$result_item = mysql_query($sql_item);
while($row_item=mysql_fetch_object($result_item)){
$item_no = $row_item->item_id;											//商品編號
$item_amount = $row_item->item_amount;						//商品購買數量

$sql_pd = "select * from  product where id = '$item_no' " ;
$result_pd = mysql_query($sql_pd);
$row_pd = mysql_fetch_object($result_pd);
$pd_name = $row_pd->name;												//商品名稱 
?>

<tr>
<td align=left><?php echo $pd_name?></td>
<td align=right><?php echo $item_amount?></td>
</tr>
<?php
} 
?>
</table>
</td>
</tr>
<tr>
<td>您訂購的商品廠商已於 <?php echo $p_date?> 為您處理 ，預計出貨後 <?php echo $n_date?> 天左右可以收到商品，預估到貨時間為 <?php echo $end_date?> 左右，請您耐心等候！</td>
</tr>

<tr height=20><td><hr></td></tr>

<tr>
<td>**************************************************************************************</td>
</tr>
<tr>
<td>請注意︰此郵件是系統自動傳送，請勿直接回覆此郵件。</td>
</tr>
<tr>
<td>**************************************************************************************</td>
</tr>

</table>

</body>